#include <iostream>
#include <list>
using namespace std;

int main() 
{
    list<int> l;
    int K = 0, number = 0;
    cin >> K;

    while (cin >> number && number >= 0) 
    {
        l.push_back(number);
    }

    if (K <= 0 || l.empty() || K > l.size()) 
    {
        printf("NULL\n");
        return 0;
    } 
    else 
    {
        auto it_fast = l.begin();
        auto it_slow = l.begin();
    
        for (int i = 0; i < K; ++i) 
        {
            it_fast++;
        }
    
        while (it_fast != l.end()) 
        {
            it_fast++;
            it_slow++;
        }
    
        cout << *it_slow << endl;
    }
    return 0;
}